<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Symbol</title>
</head>
<body>
  <script>
    let emperor = {
      prince: ['prince1', 'prince2', 'prince3'],
      princess: ['princess1', 'princess2',  'princess3']
    }
    // Symbol括号中传入的是一段描述,方便后期调试
    const prince = Symbol('bastard')
    emperor[prince] = 'bastard'
    console.log(emperor);
    console.log(Object.getOwnPropertySymbols(emperor));
  </script>
</body>
</html>